#include<bits/stdc++.h>
using namespace std;
int n,a[100005],b[100005],c[100005],maxx=-1;
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        a[x]++;b[x]++;
        if(x>maxx) maxx=x;
    }
    int j=1;
    for(int i=1;i<=100005;i++)
    {
        if(a[i])
        {
            c[j++]=a[i];
            b[j]=a[i];
        }
    }
    int sum=j--;
    for(int i=1;i<=sum;i++)
    {
        if(i!=sum && n-c[i]>c[i])
        {
            n-=c[i];
        }
        else if(i==sum)
        {
            cout<<n;
            break;
        }
        else
        {
            cout<<c[i];
            break;
        }
    }
    fclose(stdin);
    fclose(stdout);
    return 0;
}
